package jp.sourceforge.akjrcp.util;

import java.io.File;



public class YoutubeDLUtils {
public static boolean isAvailable(String youtubeDLExePath,String youtubeDLPyPath,String pythonPath){
	if(youtubeDLExePath==null && youtubeDLPyPath==null){
		return false;
	}
	
	if(youtubeDLExePath==null && pythonPath==null){
		return false;
	}
	
	if(youtubeDLExePath!=null && new File(youtubeDLExePath).exists()){
		//should i check file name?
		return true;
	}
	
	if(youtubeDLPyPath!=null && pythonPath!=null && new File(youtubeDLPyPath).exists() && new File(pythonPath).exists()){
		return true;
	}
	
	
	return false;
}

public static boolean isFLVWarningLine(String line){
	return line.startsWith("Warning: video file name does not end in .flv");
}

public static boolean isMP4WarningLine(String line){
	return line.startsWith("Warning: video file name does not end in .mp4");
}
public static final String DOWNLOAD_FORMAT="youtubedl.download_format";
public static final String YOUTUBE_DL_BEST_QUARITY="youtubedl.best_quarity";
public static final String PATH_PYTHON="youtubedl.path_python";
public static final String PATH_YOUTUBE_DL_PY="youtubedl.path_youtubedl.py";
public static final String PATH_YOUTUBE_DL_EXE="youtubedl.path_youtubedl.exe";
public static final String RENAME_FILE="youtubedl.rename_file";
public static final String fmts[]={
"(17)"+Messages.getString("youtubedl.fmt_mobile"),
	"(00)"+Messages.getString("youtubedl.fmt_flv"),
	"(34)"+Messages.getString("youtubedl.fmt_middle"),
	"(18)"+Messages.getString("youtubedl.fmt_high"),
	"(22)"+Messages.getString("youtubedl.fmt_hd"),
	};
}
